import request from '@/utils/request'

/**
 * @description 上传图片
 * */
export function uploadImg(data) {
  return request({
    url: '/base/upload',
    method: 'post',
    data
  })
}

/**
 * @description 转换拼音
 * */
export function pinyin(word_list) {
  return request({
    url: `/v1/base/get-pin-yin`,
    method: 'post',
    data:{word_list}
  })
}
/**
 * @description 获取邮编
 * */
export function postcode(a_id) {
  return request({
    url: `/v1/base/post-code`,
    method: 'get',
    params: {a_id}
  })
}
/**
 * @description 上传文件
 * */
export function uploadFile(data) {
  return request({
    url: '/base/upload-file',
    method: 'post',
    data
  })
}
/**
 * @description 页面公共的下拉数据option
 * @param jointUrl 不同页面不同的api请求
 * */
export function getOption(jointUrl) {
  return request({
    url: `/base/get-${jointUrl}-option`,
    method: 'get'
  })
}
/**
 * @description 页面公共的下拉数据option
 * @param jointUrl 不同页面不同的api请求
 * */
export function getOptions(data) {
  return request({
    url: `/base/get-enums`,
    method: 'post',
    data
  })
}

// 获取分类列表
export function getclassificationList(params) {
  return request({
    url: '/base/backend-classification/get-list',
    method: 'get',
    params
  })
}

// 语言
export function getLanguage(params) {
  return request({
    url: '/base/language/get-list',
    method: 'get',
    params
  })
}

// 员工
export function getPersonnel(params) {
  return request({
    baseURL: window.APP_GETEWAY.auth,
    url: '/tenant/organization',
    method: 'get',
    params
  })
}
// 部门
export function getDepartment(params) {
  return request({
    baseURL: window.APP_GETEWAY.auth,
    url: '/department',
    method: 'get',
    params
  })
}

//品牌
export function getBrand(params) {
  return request({
    url: '/base/brand/get-list',
    method: 'get',
    params
  })
}

// 物流属性
export function getLogistics(params) {
  return request({
    url: '/base/logistics-attributes/get-list',
    method: 'get',
    params
  })
}

// 币种
export function getCurrency(params) {
  return request({
    url: '/api/goods/get-currency',
    method: 'get',
    params
  })
}

// 分类数据
export function getColumns() {
  return request({
    url: '/v1/base/base-back-columns/list',
    method: 'get'
  })
}

// 获取仓库数据
export function getWareData(params) {
  return request({
    baseURL: window.APP_GETEWAY.wms,
    url: `/wms_v1_pc/base/get-ware-data`,
    method: 'get',
    params
  })
}

// 平台站点
export function getPlatform() {
  return request({
    baseURL: window.APP_GETEWAY.base,
    url: '/v1/platform/tree',
    method: 'get'
  })
}

// 获取供应商列表
export function getSupplie(data) {
  return request({
    baseURL: window.APP_GETEWAY.pms,
    url: `/v1/base/supplier`,
    method: "post",
    data,
  });
}

// 获取店铺
export function getShop(data) {
  return request({
    baseURL: window.APP_GETEWAY.base,
    url: `/v1/shop/drop-list`,
    method: "post",
    data,
  });
}

// 获取店铺
export function tmsOptions(data) {
  return request({
    baseURL: window.APP_GETEWAY.tms,
    url: `/options`,
    method: "post",
    data,
  });
}

// 导出中心详情
export function getExportConfig(id) {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_config/${id}`,
    method: "get",
  });
}

// 新增导出详情
export function exportRord(data) {
  return request({
    baseURL: window.APP_GETEWAY.dexh,
    url: `/export_record`,
    method: "post",
    data
  });
}